#ifndef NUMBERPROPERTY_H
#define NUMBERPROPERTY_H
#include "StomperLib/Controls/Property/NumericPropertyBase.h"
namespace StomperLib {
namespace Controls {
namespace Property {
class NumberProperty : public NumericPropertyBase {
 public:

  GWEN_CONTROL_INLINE( NumberProperty, NumericPropertyBase )
  {
    this->m_NumericUpDown->SetMin( 0 );
    this->m_NumericUpDown->SetMax( 2048 );
  }

  bool CopyValueToData( )
  {
    if (this->m_NumericUpDown->GetText( ).Get( ).empty( ))
      return false;

    auto tVal = this->m_NumericUpDown->GetText( ).c_str( );
    auto iVal = atoi( tVal );
    (*(int*) this->m_DataPointer) = iVal;

    return false;
  }

  void CopyDataToValue( )
  {
    auto iVal = *(int*) this->m_DataPointer;
    std::stringstream str;
    str << iVal;
    auto t = str.str( );
    this->m_NumericUpDown->SetText( t, false );
  }

};

}
}
}
#endif // ifndef NUMBERPROPERTY_H